<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div v-if="showDetail">今天天气好，今天天气不好</div>

       

        <button @click="onClick">点击</button>
    </div>

    
</body>

<script src="./vue.js"></script>
<script>
    const { createApp, ref } = Vue;

    createApp({
        data () {
          return {
                showDetail: false,
              
            }
        },
        
        methods:{
          onClick() {
            this.showDetail= !this.showDetail
          }
        }

           
        
    }).mount('#app')

</script>
</html>